<script src="js/proinfo/purchase/buyingApplyFor-ALTER.js"></script>
<section id="main-content">
    <section class="ng-scope">
        <div class="wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                            请购申请【请购人申请（填写采购清单、资产库申请清单）】
                        </header>
                        <div class="panel-body">
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">项目名称</label>
                                <div class="col-sm-10">
                                    <input type="text" list="browsers22" ng-model="applyInfo.projName" certus-required
                                           class="form-control" placeholder="自动检索，查询结果较多时候，系统不显示，需要尽量多输入相关字段">
                                    <datalist id="browsers22" ng-model="selected">
                                        <option ng-repeat="x in userProjSelect2" value="{{x.projName}}">
                                    </datalist>
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">申请用途</label>
                                <div class="col-sm-10">
                                    <select ng-model="applyInfo.applicationCode" certus-required class="form-control">
                                        <option ng-repeat="x in select.applyForSelect" value="{{x.code}}">
                                            {{x.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">归属地选择</label>
                                <div class="col-sm-10">
                                    <select ng-model="applyInfo.affiliationCode" certus-required class="form-control">
                                        <option ng-repeat="x in select.affiliationSelect" value="{{x.code}}">
                                            {{x.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">申请说明</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control" certus_an_limit_length="200" ng-model="applyInfo.applyInstruction"></textarea>
                                </div>
                            </div>
                        </div>
                    </section>
                    <section class="panel hdproc" style="display: none;">
                        <header class="panel-heading">
                            项目采购申请*
                        </header>
                        <div class="panel-body">
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">大类</label>
                                <div class="col-sm-10">
                                    <select class="form-control" certus_required_polyfill ng-model="applyItem.bigClassCode"
                                        ng-change="sbchanged(applyItem.bigClassCode)">
                                        <option ng-repeat="x in select.bigClassSelect" value="{{x.code}}">
                                            {{x.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group customerForm" ng-show="sbshow">
                                <label class="col-sm-2 control-label">资产类目</label>
                                <div class="col-sm-10">
                                    <select class="form-control" certus_required_polyfill ng-model="applyItem.commodityCateCode"
                                        ng-change="cateChange(applyItem.commodityCateCode)">
                                        <option ng-repeat="x in select.cateCodeSelect" value="{{x.code}}">
                                            {{x.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group customerForm" ng-show="sbshow">
                                <label class="col-sm-2 control-label">资产类别</label>
                                <div class="col-sm-10">
                                    <select class="form-control" certus_required_polyfill ng-model="applyItem.commodityClassCode">
                                        <option ng-repeat="x in select.classCodeSelect" value="{{x.code}}">{{x.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group customerForm" ng-show="sbbushow">
                                <label class="col-sm-2 control-label">类型说明</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_required_polyfill class="form-control" certus_an_limit_length="50" ng-model="applyItem.typeMark">
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">名称</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_required_polyfill certus_an_limit_length="50" class="form-control" ng-model="applyItem.name">
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">品名及规格</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_required_polyfill certus_an_limit_length="50" class="form-control" ng-model="applyItem.descAndSpec">
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">数量</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_an_limit_length_num="50" certus_required_polyfill class="form-control"
                                           ng-model="applyItem.quantity">
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">单价</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_an_limit_length_num="50" certus_required_polyfill class="form-control"
                                           ng-model="applyItem.singlePrice">
                                </div>
                            </div>
                            <div class="form-group customerForm" ng-if="applyItem.singlePrice && applyItem.quantity">
                                <label class="col-sm-2 control-label">总价</label>
                                <div class="col-sm-10">
                                    <input type="text" certus_an_limit_length_num="50" certus_required_polyfill class="form-control"
                                           ng-model="applyItem.estimatedAmount = applyItem.singlePrice*applyItem.quantity " value="{{applyItem.singlePrice*applyItem.quantity}}" disabled>
                                </div>
                            </div>
                            <div class="form-group customerForm">
                                <label class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control" certus_an_limit_length_num="200" certus_required_polyfill ng-model="applyItem.remark"></textarea>
                                </div>
                            </div>
                            <p class="default-buttons">
                                <a href="javascript:void(0);" class="button-back btn btn-info" onclick="hdproc();">取消</a>
                                <a href="javascript:void(0);" class="button-next  btn btn-info" ng-click="applyItemSubmit()">提交</a>
                            </p>
                        </div>
                    </section>
                    <section class="panel">
                        <header class="panel-heading">
                            采购申请清单
                            <i class="add-icon icon-plus" onclick="shproc();"> 新增</i>
                        </header>
                        <div class="panel-body">
                            <div id="proc1Container" class="dlshouwen-grid-container"></div>
                        </div>
                    </section>
                    <section class="panel">
                        <header class="panel-heading add-heading">
                            资产库申请清单
                            <i class="add-icon icon-plus" data-toggle="modal" href="#myModal"> 新增</i>
                        </header>
                        <div class="panel-body">
                            <div id="library1Container" class="dlshouwen-grid-container"></div>
                        </div>
                    </section>

                    <section class="panel">
                        <div class="panel-heading">
                            审批记录
                        </div>
                        <div class="panel-body">
                            <ul class="tp-ulst">
                                <li>
                                    <span>人员姓名      </span><span>修改时间</span><span>处理结果</span>
                                </li>
                                <div ng-repeat="ss in processs">
                                    <li>
                                        <span>{{ss.USER}}</span><span>{{ss.time | date:'yyyy-MM-dd hh:mm'}}</span><span>{{getsssbbb(ss.lastStatus)}}，{{ss.msg}}</span>
                                    </li>
                                </div>
                            </ul>
                        </div>
                    </section>

                    <section class="panel">
                        <div class="panel-body">
                            <p class="default-buttons">
                                <a href="javascript:void(0);" class="button-back btn btn-info" onclick="window.history.back()">返回</a>
                                <a href="javascript:void(0);" class="button-next  btn btn-success" ng-click="submmitPurchase()">确认提交</a>
                            </p>
                        </div>
                    </section>
                    <!-- Modal -->
                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                        aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <section class="panel">
                                    <div class="panel-heading add-heading">
                                        资产库信息
                                        <i class="add-icon icon-remove" data-dismiss="modal" aria-hidden="true"></i>
                                    </div>
                                    <div class="panel-body">
                                        <div class="search-heading">
                                            <span>资产类目:</span>
                                            <select class="form-control">
                                                <option>请选择</option>
                                            </select>
                                            <span>资产类别:</span>
                                            <select class="form-control" ng-model="select.productType">
                                                <option ng-repeat="x in select.assetClassSelect" value="{{x.styleId}}">
                                                    {{x.assetStyle2}}
                                                </option>
                                            </select>
                                            <label class="label label-primary" ng-click="searchProduct()">搜索</label>
                                        </div>
                                        <div id="lidContainer" class="dlshouwen-grid-container"></div>
                                        <div id="lidToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
                                    </div>
                                    <div class="panel-bg"></div>
                                </section>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                    <!-- /.modal -->
                </div>
            </div>
        </div>
    </section>
</section>